﻿@{
    ViewBag.Title = "Cập nhật mẫu Email";
    Layout = "~/Views/Shared/_Layout.Management.cshtml";
}

<form method="post" class="form" action="/Management/EmailList/Edit/@ViewBag.EmailTemplateId">
	<fieldset id="firstStep">
		<h2 class="app">
	        <strong>Cập nhật mẫu e-mail</strong>
        </h2>
		<div class="errorMessage" data-bind="visible: InvalidateForm" >
			<span class="error">Xin hãy nhập thông tin chính xác.</span>
		</div>				
		<div class="title">
			<h3>Thông tin email</h3>
		</div>
		<div class="columns">
			<div class="col columnedit">
				<div class="row">
					<label>Loại email:</label>
				</div>
                <div class="row">
					<input class="text" type="text" data-bind="value: EmailType, attr:{maxlength:20}" name="EmailType" />
                </div>
				<div class="row">
					<label>Tiêu đề:</label>
				</div>
                <div class="row">
					<input class="text" type="text" style="width:80%" data-bind="value: SubjectLine, attr:{maxlength:250}" name="SubjectLine" />
                </div>                    
				<div class="row">
					<label>Từ địa chỉ:</label>
				</div>
                <div class="row">
					<input class="text" type="text" style="width:80%" data-bind="value: FromAddress, attr:{maxlength:50}" name="FromAddress" />
                </div>
				<div class="row">
					<label>CC:</label>
				</div>
                <div class="row">
					<input class="text" type="text" style="width:80%" data-bind="value: CC, attr:{maxlength:50}" name="CC" />
                </div>
				<div id="editform" class="row">
					<input class="text" type="checkbox" data-bind="checked: Active" name="Active" /> &nbsp;&nbsp;Kích hoạt
				</div>

				<div class="row">
					<label>Nội dung</label>
				</div>
                <div class="row">
					<textarea id="elm1" name="BodyText" rows="30" cols="80" style="width: 100%" data-bind="text: BodyText">
                    </textarea>
                </div>
			</div>
		</div> 

        <!-- button below -->
		<div class="foot-info">
			<h3 class="centered-wbtn centered-wbtn-bottom save">
  				<span>
  					<a class="btn btn-cancel-page" href="/Management/EmailList">previous</a>
					<input type="button" class="btn btn-submit-page" data-bind="click: SubmitForm" value="Submit" />
                </span>
			</h3>
		</div>
	</fieldset>
</form>
<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model)));
</script>
<script src="/Scripts/ViewModel/editemail.js" type="text/javascript"></script>

<script src="/TinyMCE/tiny_mce.js" type="text/javascript"></script>
<script src="/TinyMCE/tinymce.initialize.js" type="text/javascript"></script>
